<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="UserTable">
    <div class="layui-card-body padding-left-40">

        <fieldset class="layui-bg-gray">
            <legend><b class="layui-badge think-bg-violet">商户账号</b></legend>

            <div class="layui-row layui-col-space15">
                <div class="layui-col-xs2 text-center padding-top-15">
                    <input type="hidden" data-cut-width="500" data-cut-height="500" data-max-width="500" data-max-height="500" name="headimg" value="{$vo.logo|default=''}">
                    <script>$('[name=headimg]').uploadOneImage();</script>
                </div>
                <div class="layui-col-xs5">
                    <label class="block relative">
                        <span class="help-label"><b>商户账号</b>User Name</span>
                        {if isset($vo) and isset($vo.username)}
                        <input name="username" value='{$vo.username|default=""}' required readonly class="layui-input think-bg-gray">
                        {else}
                        <input name="username" value='{$vo.username|default=""}' required pattern="phone" vali-name="商户账号" placeholder="请输入商户账号" class="layui-input">
                        {/if}
                        <span class="help-block">请输入手机账号，创建后不能再次修改.</span>
                    </label>
                </div>
                <div class="layui-col-xs5">
                    <label class="block relative">
                        <span class="help-label"><b>商户名称</b>Nick Name</span>
                        <input name="merchname" value='{$vo.merchname|default=""}' required vali-name="商户名称" placeholder="请输入商户名称" class="layui-input">
                        <span class="help-block">用于区分商户的名称，请尽量不要重复.</span>
                    </label>
                </div>
            </div>

        </fieldset>

        <fieldset class="layui-bg-gray">
            <legend><b class="layui-badge think-bg-violet">商户资料</b></legend>
            <div class="layui-row layui-col-space15">
                <div class="layui-col-xs6">
                    <label class="relative block">
                        <span class="help-label"><b>商户编码</b>Merchno</span>
                        <input name="merchno" value='{$vo.merchno|default=""}' required vali-name="商户编码" placeholder="请输入商户编码" class="layui-input">
                        <span class="color-desc">必填</span>
                    </label>
                </div>
                <div class="layui-col-xs6">
                    <label class="relative block">
                        <span class="help-label"><b>状态</b>Status</span>
                        <div>
                          <select name="status" id="status">
                              <option value="0" {if isset($vo.status) and $vo.status == 0}selected='selected'{/if}>待入驻</option>
                              <option value="1" {if isset($vo.status) and $vo.status == 1}selected='selected'{/if}>入驻中</option>
                              <option value="2" {if isset($vo.status) and $vo.status == 2}selected='selected'{/if}>已禁用</option>
                          </select>
                        </div>
                    </label>
                </div>
            </div>
            <div class="layui-row layui-col-space15">
                <div class="layui-col-xs6">
                    <label class="relative block">
                        <span class="help-label"><b>联系人</b>Contact</span>
                        <input type="tel" maxlength="11" name="realname" value='{$vo.realname|default=""}' required vali-name="联系人" placeholder="请输入联系人" class="layui-input">
                        <span class="color-desc">必填，请填写联系人名称</span>
                    </label>
                </div>
                <div class="layui-col-xs6">
                    <label class="relative block">
                        <span class="help-label"><b>联系手机</b>Contact Mobile</span>
                        <input type="tel" maxlength="11" name="mobile" value='{$vo.mobile|default=""}' required pattern="phone" vali-name="联系手机" placeholder="请输入用户联系手机" class="layui-input">
                        <span class="color-desc">可选，请填写用户常用的联系手机号</span>
                    </label>
                </div>
            </div>
            <div class="layui-row layui-col-space15">
                <div class="layui-col-xs6">
                    <label class="relative block">
                        <span class="help-label"><b>商户类型</b>Type</span>
                        <select id='type' name="type" lay-verify="required" {if isset($vo) and isset($vo.type)}disabled{/if}>
                          <option value=""></option>
                          <option value="0" {if isset($vo.type) and $vo.type == 0}selected='selected'{/if}>供货商</option>
                          <option value="1" {if isset($vo.type) and $vo.type == 1}selected='selected'{/if}>业务员</option>
                        </select>
                    </label>
                </div>
            </div>
            <label class="layui-form-item block relative margin-top-10">
                <span class="help-label"><b>商户简介</b>Remark</span>
                <textarea placeholder="请输入用户描述" class="layui-textarea" name="desc">{$vo.desc|default=""}</textarea>
            </label>
        </fieldset>

    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>